import {
  FcCheckBox,
  FcFormControl,
  FcFormItem,
  FcInput,
} from "solid-fire-controls";
import { Component } from "solid-js";

export interface PackageSourceFormProps {
  creating?: boolean;
}

const PackageSourceFormPart: Component<PackageSourceFormProps> = (props) => {
  return (
    <>
      <FcFormItem name={"name"} label={"Name"}>
        <FcFormControl
          control={FcInput}
          controlProps={{ disabled: !props.creating }}
        ></FcFormControl>
      </FcFormItem>
      <FcFormItem name={"source"} label={"Source"}>
        <FcFormControl control={FcInput}></FcFormControl>
      </FcFormItem>
      <FcFormItem name={"isEnabled"} label={"Enabled"}>
        <div>
          <FcFormControl
            control={FcCheckBox}
            controlProps={{ type: "switch", inline: true, children: " " }}
          ></FcFormControl>
        </div>
      </FcFormItem>
    </>
  );
};

export default PackageSourceFormPart;
